import Http from "@/libs/Http";

export async function queryOptions() {
  let response = await Promise.all([
    Http.post('/quanying-service-provider-system/product/ProductController/selectTypeDetail.action', {
      fatherid:4
    }),
    Http.post('/quanying-service-provider-system/product/ProductController/selectTypeDetail.action', {
      fatherid:3
    }),
    Http.post('/quanying-service-provider-system/product/ProductController/selectTypeDetail.action', {
      fatherid:1
    }),
    Http.post('/quanying-service-provider-system/product/ProductController/selectTypeDetail.action', {
      fatherid:2
    }),
  ])
  
  return response;
}

export function getProdDetailFor(params) {//查询电站列表
  return Http.post('/quanying-service-provider-system/product/ProductController/getProdDetailFor.action', params);
}


export function getProdDetail5(params) {//业务员查询电站列表
  return Http.post('/quanying-service-provider-system/product/ProductController/getProdDetail5.action', params);
}

export function getFileUrl1(params) {
  return Http.post('/quanying-service-provider-system/product/ProductController/getFileUrl1.action', params);
}

export function getProdInfo(params) {//根据电站id查询电站详情
  //return Http.post('/quanying-WebPortal-service-provider/common/ProductController/FPprodpreviewdata.action', params);
  // return Http.post('/quanying-service-provider-system/product/ProductController/getProdInfo.action', params);
  let param={
    id:params.id
  }
  // console.log('params.status==',params.status);
  // if(params.status!=''){//审核状态不为空，即查看自己发布的电站详情
  //   return Http.post('/quanying-service-provider-system/product/ProductController/getProdInfo1.action', param);
  // }else{//审核状态为空，即搜索的已审核的电站
  //   return Http.post('/quanying-service-provider-system/product/ProductController/getProdInfo.action', param);
  // }
  if(params.source=='mine'||params.source=='adminMine'){//来源是 我的页面 ，即查看自己发布的电站详情
    return Http.post('/quanying-service-provider-system/product/ProductController/getProdInfo1.action', param);
  }else{//来源是搜索页search，即搜索的已审核的电站，或者是分享share的链接，展示的都是公开项
    return Http.post('/quanying-service-provider-system/product/ProductController/getProdInfo.action', param);
  }
}

export function getDisplay(params) {//根据电站id查询电站详情哪些能公开
  let param={
    id:params.id
  }
  return Http.post('quanying-service-provider-system/product/ProductController/getDisplay.action', param);

}